#include "DengueVirus.h"
DengueVirus::DengueVirus()
{
	cout<<"Constructor DengueVirus class"<<endl;
	DengueVirus::DoBorn();
	DengueVirus::InitResistance();
	
}
DengueVirus::DengueVirus(const DengueVirus &dengueVirus):Virus(dengueVirus)
{
	this->m_protein = new char[SIZE_PROTEIN];
	this->m_protein = dengueVirus.m_protein;
	
}

DengueVirus::~DengueVirus()
{
	cout<<"Destructor DengueVirus!!!"<<endl;
	DengueVirus::DoDie();
	
}
void DengueVirus::DoBorn()
{

	Virus::LoadDNAInformation();
	this->m_protein = new char[SIZE_PROTEIN];
	switch(rand()%3)
	{
	case 0: strcpy(this->m_protein,"NS3");break;
	case 1: strcpy(this->m_protein,"NS5");break;
	case 2: strcpy(this->m_protein,"E5");break;
	}
}
list<DengueVirus*> DengueVirus::DoClone()const
{
	DengueVirus* _dengueVirus[2];
	_dengueVirus[0] = new DengueVirus(*this);
	_dengueVirus[1] = new DengueVirus(*this);
	cout<<"DengueVirus clone!!!"<<endl;
	return  *_dengueVirus;
}
int DengueVirus::GetType()
{
	return DENGUEVIRUS;
}
void DengueVirus::DoDie()
{
	//delete m_protein;
	delete m_dna;
	delete m_protein;
	//delete m_protein;
	
}
void DengueVirus::InitResistance()
{
	if(this->m_protein == "NS3")
		this->m_resistance = rand()%11 + 1;
	if(this->m_protein == "NS5")
		this->m_resistance = rand()%21 + 11;
	if(this->m_protein == "E5")
		this->m_resistance = rand()%31 + 21;
}